<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>XSS Platform</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="{$url.themePath}/css/bootstrap.min.css">
<link rel="stylesheet" href="{$url.themePath}/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="{$url.themePath}/css/css.css">
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://www.bootstrapcdn.com/bootstrap/2.3.1/js/bootstrap.min.js"></script>
<script type="text/javascript">
{literal}
function ShowContent(id,o){
	if($("#"+id).css("display")=="none"){
		$("#"+id).show();
		$(o).html("折叠");
	}else{
		$("#"+id).hide();
		$(o).html("展开");	
	}
}
{/literal}
</script>
</head>
<body>
{include file="header.html"}
<div class="container">
{include file="menus.html"}
<div class="col-sm-9">
          <div class="panel panel-default">
    	<div class="panel-heading">配置代码</div>
<form style="padding: 10px 15px;" id="contentForm" action="{$url.root}/index.php?do=project&act=setcode_submit" method="post">
<input type="hidden" name="token" value="{$show.user.token}" />
<input type="hidden" name="id" value="{$project.id}" />
<input type="hidden" name="ty" value="{$ty}" />
<fieldset> 
	<div id="contentShow"></div>
	<p> 
		<label for="title">项目名称</label><br> 
		<h2>{$project.title}</h2> 
	</p> 
	<p> 
		<ul id="moduleList">
        	{foreach from=$modulesCan key=k item=v}
        	<li style="margin-bottom:10px"> <input onclick="{literal}if(this.checked){ $('#mset_'+this.value).show() }else{ $('#mset_'+this.value).hide() }{/literal}" name="modules[]" value="{$v.id}" type="checkbox"{if isset($v.choosed) && $v.choosed==1} checked="checked"{/if} /> {$v.title}
            <a href="javascript:void(0)" onclick="ShowContent('m_{$k}',this)">展开</a>
            {if is_array($v.setkeys) && $v.setkeys|@count>0}
            <div id="mset_{$v.id}" style="display:{if isset($v.choosed) && $v.choosed==1}block{else}none{/if}">
            需要配置的参数<br/>
            	{foreach from=$v.setkeys item=setkey}
            	{if $v.id==1 && $setkey.key=='keepsession'}
	            <input type="radio" name="setkey_{$v.id}_{$setkey.key}" value="0"{if empty($setkey.value) ||  $setkey.value!=1} checked="checked"{/if} /> 无keepsession &nbsp;
	            <input type="radio" name="setkey_{$v.id}_{$setkey.key}" value="1"{if isset($setkey.value) &&  $setkey.value==1} checked="checked"{/if} /> keepsession
	            {else}
                {$setkey.key} : <input type="text" name="setkey_{$v.id}_{$setkey.key}" value="{isset($setkey.value) && $setkey.value}" /><br/>
                {/if}
                {/foreach}
            </div>
            {/if}
            <ul id="m_{$k}" style="display:none">
                <li style="list-style:none">参数:<br /><pre>{$v.keys}</pre></li>
                <li style="list-style:none">代码:<br /><pre>{$v.code}</pre></li>
            </ul>
            </li>
            {/foreach}
        </ul>
	</p>
	<p> 
		<label for="code"><input type="checkbox" checked="checked" disabled="disabled" /> 自定义代码</label><br> 
		<textarea name="code" id="code"></textarea>
	</p>
	<p> 
		<input class="btn btn-success" type="submit" value="{if $ty=='create'}下一步{else}配置{/if}"> &nbsp;&nbsp;
		<input class="btn btn-success" type="button" value="取消" onclick="history.go(-1)"> 
	</p> 
</fieldset> 
</form>
</div>
</div>
</div>
</body>
</html>